package com.ykq.controller;

import com.ykq.pojo.Dept;
import com.ykq.service.DeptService;
import com.ykq.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @program: vue_axios_ssm
 * @description:
 * @author: 闫克起2
 * @create: 2023-05-12 09:31
 **/
@Controller
@RequestMapping("/dept")
public class DeptController {

    @Autowired
    private DeptService deptService;

    @RequestMapping("/list")
    @ResponseBody
    public Result list(){
         List<Dept> list=deptService.findAll();
         return new Result(200,"查询所有部门信息成功",list);
    }
}
